<template>
    <div>
        <el-result
        icon="warning"
        title="404"
        sub-title="请回到主页"
        >
        <template #extra>
          <el-button type="primary" @click="$router.push('/home/')">Back</el-button>
          <el-button type="primary" @click="Add()">{{ count }}</el-button>
          <el-button type="primary" @click="Sub()">{{ form.cnt }}</el-button>
        </template>

      </el-result>
    </div>
</template>

<script setup>//定义变量，函数
import { ref ,reactive} from "vue";//页面的值可以立即响应变化

let count = ref(1);//普通类型
function Add() {
  count.value++;
  console.log(count.value)
}

let form = reactive({cnt:20})//复杂的对象类型
function Sub() {
  form.cnt--;
  console.log(form.cnt)
}
</script>